import { domainService } from "~/config/server";
import { NetService } from "~/utils/net.service";
import { Inject, Debounce } from "~/core/decorator";
import { FilterService } from "~/utils/filter.service";

export class TurnRecordService {
  @Inject(NetService)
  private netService: NetService;

  /**
   * 分页获取流转记录
   */
  public findTurnRecordDetailPage(caseNumber, queryData, page) {
    return this.netService.send({
      server: domainService.turnRecordController.findTurnRecordDetailPage,
      data: {
        caseNumber,
        caseTurnTimeStart: FilterService.dateRanageFormat(queryData.caseTurnTime)
          .start,
        caseTurnTimeEnd: FilterService.dateRanageFormat(queryData.caseTurnTime).end,
        triggerAction: queryData.triggerAction,
        operatorRealName: queryData.operatorRealName
      },
      page
    });
  }

  /**
   * 案件流转查询
   */
  public findAllTurnRecord(data, page) {
    return this.netService.send({
      server: domainService.turnRecordController.findAllTurnRecord,
      data,
      page
    })
  }
}
